<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/8/18 0018
  Time: 15:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/include/taglibs.jsp" %>

<script src="${path}/static/taoshunda/business/business.js"></script>
<link href="${path}/static/css/public/public.css" rel="stylesheet" type="text/css">
<%--<script>--%>
<%--var editor = UE.getEditor('editor');--%>
<%--</script>--%>

<div class="input-group col-xs-2" style="float: left;margin-bottom: 3px">
    <input type="text" class="form-control entry" id="nameBusiness" placeholder="商家名称">
</div>
<div class="input-group col-xs-2" style="float: left;margin-left: 3px;margin-bottom: 3px">
    <input type="text" id="created" class="form-control rangedate entry" placeholder="注册时间"/>
</div>
<div class="input-group col-xs-2" style="float: left;margin-left: 3px;margin-bottom: 3px">
    <input type="text" id="lastTime" class="form-control rangedate entry" placeholder="最后登录时间"/>
</div>

<div style="float: left;margin-bottom: 3px;margin-left: 3px">
    <select class="form-control entry" id="types">
        <option value="0">--商家分类--</option>
    </select>
</div>

<div style="float: left;margin-bottom: 3px;margin-left: 3px">
    <select class="form-control entry" id="citys">
        <option value="0">--城市选择--</option>
    </select>
</div>

<div style="float: left;margin-left: 10px;margin-bottom: 3px">
    <button type="button" class="btn query_button" id="btnsearch" onclick="queryBusiness()"
            style="float: left;width: 150%">
        <%--<span class="glyphicon glyphicon-search" aria-hidden="true"></span>--%>
        查询
    </button>
</div>

<table id="table"
       class="table table-striped table-bordered"
       data-toggle="table"
       data-toolbar="#admintoolbar"
       data-url="${path}/web/business/queryBusinessList"
       data-side-pagination="server"
       data-pagination="true"
       data-page-list="[5, 10, 20, 50, 100, 200]"
>
    <thead>
    <tr>
        <th data-field="id" data-visible="false">编号</th>
        <th data-field="bussName">商家名称</th>
        <th data-field="name">城市</th>
        <th data-field="adress">地址</th>
        <th data-field="created">创建时间</th>
        <th data-field="lastTime">最后登录时间</th>
        <%--<th data-formatter="business.status">商家状态</th>--%>
        <th data-formatter="business.state" data-events="operate">启用/禁用</th>
        <%--<th data-formatter="business.GoodFaith" data-events="operateFaith">诚信商家</th>--%>
        <th data-formatter="business.operateFormatter" data-events="operateEvent">操作</th>
    </tr>
    </thead>
</table>


<div id="queryBusinessOrder-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="75%"
     model-left="25%">
    <div class="box-header">
        <h3 class="box-title">订单信息</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <table id="orderBusiness"
                   data-toggle="table"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-page-list="[50, 100, 200]">
                <thead>
                <tr>
                    <th data-field="orderNumber">订单编号</th>
                    <th data-field="nickName">买家名称</th>
                    <%--<th data-field="goodsName">商品名称</th>--%>
                    <%--<th data-field="count">商品数量</th>--%>
                    <%--<th data-field="univalent">单价</th>--%>
                    <%--<th data-field="allMoney">总价</th>--%>
                    <th data-formatter="orderState">订单状态</th>
                    <%--<th data-field="payType">支付方式</th>--%>
                    <th data-formatter="payType">支付方式</th>
                    <th data-field="goodsAddress">收货地址</th>
                    <th data-field="created">创建时间</th>
                    <th data-formatter="operateFormatterDetail" data-events="operateEventDetail">操作</th>
                </tr>
                </thead>
            </table>
            <div class="box-footer">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>

<div id="queryBusinessDetails-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="60%">
    <div class="box-header">
        <h3 class="box-title">收支明细</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <table id="details"
                   data-toggle="table"
                   data-toolbar="#admintoolbar"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-page-list="[50, 100, 200]">
                <thead>
                <tr>
                    <th data-formatter="sourceType">金额来源</th>
                    <th data-field="balance">金额</th>
                    <th data-field="created">创建时间</th>
                </tr>
                </thead>
            </table>
            <div class="box-footer">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>

<div id="examineCoupon-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="45%">
    <div class="box-header">
        <h3 class="box-title">满减活动</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <table id="coupon"
                   data-toggle="table"
                   data-toolbar="#admintoolbar"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-page-list="[50, 100, 200]">
                <thead>
                <tr>
                    <th data-field="id" data-visible="false"></th>
                    <th data-field="name">优惠名称</th>
                    <th data-field="minMoney">满足金额</th>
                    <th data-field="subMoney">减少金额</th>
                    <th data-field="validityDays">有效期(天)</th>
                    <th data-field="created">创建时间</th>
                    <th data-field="receiveEndTime">领取结束时间</th>
                </tr>
                </thead>
            </table>
            <div class="box-footer">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>

<div id="businessDetails-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="70%"
     model-left="30%">
    <div class="box-header">
        <h3 class="box-title">商家详情</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <input id="id" type="hidden">
            <div class="col-md-6">
                <div class="form-group">
                    <label>商家账号:</label>
                    <input type="text" class="form-control " id="account" readonly="readonly">
                </div>
            </div>
            <div class="col-md-6">
                <div class="form-group">
                    <label>商家名称:</label>
                    <input type="text" class="form-control " id="businessName" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>商家分类:</label>
                    <input type="text" class="form-control " id="businessType" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>商家电话:</label>
                    <input type="text" class="form-control " id="businessPhone" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>紧急联系人:</label>
                    <input type="text" class="form-control " id="emergencyContact" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>紧急电话:</label>
                    <input type="text" class="form-control " id="emergencyContactTel" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>业务电话:</label>
                    <input type="text" class="form-control " id="telephone" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>营业时间(开始):</label>
                    <input type="text" class="form-control " id="start" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>营业时间(关门):</label>
                    <input type="text" class="form-control " id="end" readonly="readonly">
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>城市:</label>
                    <select class="form-control" id="getCity" disabled="true">
                        <option value="0">--请选择--</option>
                    </select>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>区域:</label>
                    <select class="form-control" id="getCityArea" disabled="true">
                        <option value="0">--请选择--</option>
                    </select>
                </div>
            </div>

            <div class="col-md-6">
                <div class="form-group">
                    <label>地址:</label>
                    <input type="text" class="form-control " id="address" readonly="readonly">
                </div>
            </div>

            <div class="col-md-12">
                <div class="form-group">
                    <label>优惠活动:</label>
                    <textarea id="editor" class="form-control" disabled="true" style="width: 50%">
                </textarea>
                </div>
            </div>

            <%--<div class="col-md-12">--%>
            <%--<div class="form-group">--%>
            <%--<label>商家轮播:</label>--%>
            <%--<div class="col-md-12">--%>
            <%--<img width="150" height="150" id="carousel" src="${path}/static/images/commons/img_add.png">--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--</div>--%>

            <%--<div class="col-md-4">--%>
            <%--<div class="form-group">--%>
            <%--<label>商家logo:</label>--%>
            <%--<div class="col-md-12">--%>
            <%--<img width="150" height="150" id="logo" src="${path}/static/images/commons/img_add.png">--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--</div>--%>

            <div class="col-md-4" style="margin-left: 1%">
                <div class="form-group">
                    <label>营业执照:</label><br>
                    <img  height="150" id="licneseShow" src="${path}/static/images/commons/img_add.png" onclick="enlargeImage(this)">
                </div>
            </div>

            <%--<div class="col-md-4">--%>
            <%--<div class="form-group">--%>
            <%--<label>门店照片:</label>--%>
            <%--<div class="col-md-12">--%>
            <%--<img width="150" height="150" id="store" src="${path}/static/images/commons/img_add.png">--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--</div>--%>

            <%--<div class="col-md-4">--%>
            <%--<div class="form-group">--%>
            <%--<label>店内照片:</label>--%>
            <%--<div class="col-md-12">--%>
            <%--<img width="150" height="150" id="shop" src="${path}/static/images/commons/img_add.png">--%>
            <%--</div>--%>
            <%--</div>--%>
            <%--</div>--%>

            <div class="col-md-3">
                <div class="form-group">
                    <label>身份证:</label><br>
                    <img  height="150" id="idCard" src="${path}/static/images/commons/img_add.png" onclick="enlargeImage(this)">
                </div>
            </div>

            <div class="col-md-4" style="margin-left: 7%">
                <div class="form-group">
                    <label style="margin-left: 1%">服务许可证:</label><br>
                    <img  height="150" id="service" src="${path}/static/images/commons/img_add.png" onclick="enlargeImage(this)">
                </div>
            </div>

            <div class="col-md-12">
                <div class="form-group">
                    <label style="margin-left: 1%">门店照片:</label><br>
                    <div id="store">

                    </div>
                </div>
            </div>

            <div class="col-md-12" style="margin-top: 2%">
                <div class="form-group">
                    <label style="margin-left: 1%">店内照片:</label><br>
                    <div id="instore">

                    </div>
                </div>
            </div>

            <div class="col-md-12">
                <div class="box-footer">
                    <button class="btn btn-danger close-model">关闭</button>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="updateBusiness-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="45%">
    <div class="box-header">
        <h3 class="box-title">修改商家</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <form role="form" method="post" id="updateBusinessFrom">
                <input id="updateId" name="id" type="hidden">

                <div class="form-group">
                    <label>商家名称:</label>
                    <input type="text" class="form-control " name="bussName" required="required" style="width: 50%"
                           id="name">
                </div>

                <div class="form-group">
                    <label>商家分类:</label>
                    <input type="hidden" class="form-control " name="bussId" required="required" style="width: 50%"
                           id="type">
                    <select id="selected" class="form-control" style="width: 50%">

                    </select>
                </div>

                <div class="form-group">
                    <label>商家电话:</label>
                    <input type="text" class="form-control " name="bussPhone" required="required" style="width: 50%"
                           id="updatePhone">
                </div>

                <%--<div class="form-group">--%>
                    <%--<label>业务电话:</label>--%>
                    <%--<input type="text" class="form-control " name="serviceTel" required="required" style="width: 50%"--%>
                           <%--id="updateTel">--%>
                <%--</div>--%>

                <div class="form-group">
                    <label>城市:</label>
                    <input type="hidden" id="city" name="cityId">
                    <select class="form-control" id="cityIds" style="width: 50%" onclick="areaCityInfo()" >
                        <option value="0">--请选择--</option>
                    </select>
                </div>

                <div class="form-group">
                    <label>区域:</label>
                    <input type="hidden" id="area" name="areaId">
                    <select class="form-control" id="areaCity" style="width: 50%" >
                        <option value="0">--请选择--</option>
                    </select>
                </div>

                <div class="form-group">
                    <label>地址:</label>
                    <input type="text" class="form-control " name="address" required="required" style="width: 50%"
                           id="updateAddress">
                </div>

                <div class="col-xs-10" style="margin-top: 1%">
                    <div class="form-group">
                        <input type="hidden" name="serviceLince" id="updateServiceLince">
                        <label>服务许可证:</label><br>
                        <div style="margin-top: 1%">
                            <img  height="150" id="serviceLince" src="${path}/static/images/commons/img_add.png"
                                 class="addImage">
                        </div>
                    </div>
                </div>

                <div class="col-xs-3" style="margin-top: 1%">
                    <div class="form-group">
                        <input type="hidden" name="bussLicnese" id="updateBusLicnese">
                        <label>营业执照:</label><br>
                        <img  height="150" id="busLicnese" src="${path}/static/images/commons/img_add.png"
                             class="addImage">
                    </div>
                </div>
            </form>
            <div class="col-xs-10">
                <button class="btn btn-info" data-event="submit-updateBusiness">确定</button>
                &nbsp;
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>

<div id="updatePwd-div" class="slidingmenu box-model box box-info" model-width="45%" model-height="60%">
    <div class="box-header">
        <h3 class="box-title">重置密码</h3>
    </div>
    <div>
        <form role="form" method="post" id="pwdFrom">
            <input id="ids" name="id" type="hidden">
            <div class="form-group" style="margin-left: 20%;margin-top: 10%">
                <label>重置密码:</label>
                <input type="text" class="form-control" name="pwd" value="123456" required="required" id="updatePwd"
                       readonly="readonly"
                       style="width: 60%">
            </div>
        </form>
    </div>
    <div style="margin-left: 10%;margin-top: 20%">
        <button class="btn btn-info" data-event="submit-updatePwd">确定</button>
        &nbsp;
        <button class="btn btn-danger close-model" style="margin-left: 50%">关闭</button>
    </div>
</div>

<div id="storePicRecommend-div" class="slidingmenu box-model box box-info">
    <div class="box-header">
        <h3 class="box-title">推荐广告位</h3>
    </div>
    <div style="margin-top: 4%">
        <form role="form" method="post" id="recommendFrom">
            <input id="orderId" name="id" type="hidden">
            <input id="cId" name="carouselId" type="hidden">
            <input id="isPosition" name="isPosition" type="hidden">
            <input id="state" name="state" type="hidden">

            <div class="form-group" style="margin-left: 2%">
                <label>城市:</label>
                <input type="hidden" id="recommend" name="cityId">
                <select class="form-control" id="cityRecommend" style="width: 50%">
                    <option value="0">--请选择--</option>
                </select>
            </div>

            <div class="form-group" style="margin-left: 2%">
                <input type="hidden" name="storePic" id="updateStorePic">
                <label>商家门店轮播:</label><br>
                <img  height="150" id="storePic" src="${path}/static/images/commons/img_add.png"><br>
                <span style="color: red">推荐上传图片为800 x 800以上分辨率的图片</span>
            </div>
        </form>
    </div>
    <div class="box-footer">
        <button class="btn btn-info" data-event="submit-storePicRecommend">确定推荐</button>
        &nbsp;
        <button class="btn btn-danger close-model">关闭</button>
    </div>
</div>


<div id="orderGoodsDetail-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="85%"
     model-left="15%">
    <div class="box-header">
        <h3 class="box-title">订单信息</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <table id="orderGoodsDetail"
                   data-toggle="table"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-page-list="[50, 100, 200]">
                <thead>
                <tr>
                    <th data-field="orderNumber">订单编号</th>
                    <%--<th data-field="nickName">买家名称</th>--%>
                    <th data-field="goodsName">商品名称</th>
                    <th data-field="count">商品数量</th>
                    <th data-field="univalent">单价</th>
                    <%--<th data-field="allMoney">总价</th>--%>
                    <th data-field="created">创建时间</th>
                </tr>
                </thead>
            </table>
            <div class="box-footer">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>

<div id="goodsList-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="65%"
     model-left="35%">
    <div class="box-header">
        <h3 class="box-title">商品管理</h3>
    </div>

    <div class="box box-info">

        <input type="hidden" id="companyId">
        <div class="col-xs-3" style="float: left;margin-right: 6px;margin-bottom: 1%;margin-top: 1%">
            <input type="text" class="form-control entry" placeholder="请输入商品名称" id="nameGoods"/>
        </div>

        <div class="col-xs-2" style="float: left;margin-right: 6px;margin-bottom: 1%;margin-top: 1%">
            <button class="btn query_button" onclick="searchGoods()" style="margin-left: 5px;width: 70%">
                查询
            </button>
        </div>
        <div class="box-body">
            <table id="goods"
                   data-toggle="table"
                   data-side-pagination="server"
                   data-pagination="true"
                   data-page-list="[50, 100, 200]">
                <thead>
                <tr>
                    <th data-formatter="goodsPic">商品图片</th>
                    <th data-field="name">商品名称</th>
                    <th data-field="created">创建时间</th>
                    <th data-formatter="operateGoods" data-events="operateEventDetail">操作</th>
                </tr>
                </thead>
            </table>
            <div class="box-footer">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>
<div id="detailImage-div" style="z-index:999"  class="slidingmenu box-model box box-info">
    <div class="box box-info">
        <div class="box-body">
            <div class="form-group">
                <div id="image" style="margin-top: 5%">

                </div>
            </div>
            <div class="box-footer">
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div><!-- /.box-body -->
    </div>
</div>